home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 June: Reference Library / Dev.CD Jun 99 RL Disk 1.toast / Technical Documentation / Develop / develop Issue 28 / develop Issue 28 code / MacApp Debugging / TwistDownLists / TwistDownGlobals.r < prev    next >
Encoding:
Text File  |  1996-10-04  |  11.2 KB  |  292 lines  |  [TEXT/MPS ]

  1. //--------------------------------------------------------------------------------------------------                                                
  2. // TwistDownGlobals.r
  3. // ETO20 MacApp 3.3.1, MPW 3.4.1
  4. // Copyright © 1996 by Conrad Kopala
  5. // Twist Down Lists version 2.0a0 7/15/96
  6. //--------------------------------------------------------------------------------------------------
  7.  
  8. #ifndef __TWISTDOWNGLOBALS__
  9. #define __TWISTDOWNGLOBALS__
  10.  
  11. // My programs always include an AppGlobals.h file and an AppGlobals.r file. 
  12. // The first part of the AppGlobals.h file parallels the AppGlobals.r file. 
  13. // These two files define all command numbers, menu IDs, resource IDs, etc.
  14. // This approach to organizing program files arose out of development scenarios 
  15. // involving multiple cooperative programs that share common files. 
  16. // Consequently, I do not have to search through files to find them because
  17. // I know where they are. The risk of duplication and confusion is minimized.
  18. // For example, it is less likely with this approach that something like 
  19. // kDefaultOKItemID will be defined more than once.
  20.  
  21. //The following are also defined in TwistDownGlobals.h
  22. //----------------------------------------------------------------------------------------
  23. // Finder stuff
  24. //----------------------------------------------------------------------------------------
  25. #define kSignature                            'TDL%'            // Application signature 
  26. #define kFileType                                'disk'            // Data file type 
  27. #define kAETwistDownListsSuite    'TDL%'            // AppleEvent class for TwistDownLists
  28. //----------------------------------------------------------------------------------------
  29. // AboutBoxIcon ID
  30. //----------------------------------------------------------------------------------------
  31. #define kAboutBoxIcon    2000
  32.  
  33. //--------------------------------------------------------------------------------------------------
  34. // Menu IDs.
  35. //--------------------------------------------------------------------------------------------------
  36.  
  37.  
  38. #define mFormatMenu                            4
  39. #define mControlMenu                        5
  40. #define mWindowsMenu                        6
  41. #if qDebug
  42. #define mTestMenu                                7
  43. #endif
  44. #define mFontMenu                                8
  45.  
  46. //--------------------------------------------------------------------------------------------------
  47. // Command Numbers For Menu Items 
  48. //--------------------------------------------------------------------------------------------------
  49.  
  50. #define cExpandAll                        1000    //menu command number
  51. #define cCollapseAll                    1001    //menu command number
  52. #define cShowInvisibleFiles        1002    //menu command number
  53. #define cFailHere                            1003    //menu command number
  54. #define cAllowUnlimitedDocs        1004    //menu command number
  55.  
  56. #define cAppleEventRouting            1100    //menu command number for toggle between SendToDoc and SendToView
  57. #define cSendAppleEvents                1101    //menu command number
  58.  
  59. #define cWritingDirection                1110    //menu command number for toggle between LeftToRight and RightToLeft
  60. #define cUseSystemDirection            1111    //menu command number
  61.  
  62. #define cChangeWritingDirection    1112    //used as common command number for TChangeWritingDirectionCommand
  63.  
  64. //Change Font commands
  65. #define cFont                    1750    //Font menu item & is for hierarchical sub-menu
  66. #define cChangeFont     1751    //used as common command number for TChangeFontCommand
  67.  
  68. /* Change Font-size commands */
  69. #define cLargerFontSize        1761    //menu command number
  70. #define cSmallerFontSize     1762    //menu command number
  71. #define cOtherFontSize         1763    //menu command number
  72.  
  73. #define cChangeFontSize     1764    //used as common command number for TChangeFontSizeCommand
  74.  
  75. #define cFontSizeBase            1800
  76. #define cFontSizeMin            1809
  77. #define cFontSizeMax            1896
  78.  
  79. #if qDebug
  80. #define cCountObjects                        1901    //menu command number
  81. #define cResetObjectCount                1902    //menu command number
  82. #define cPrintBaseClassInfo            1903    //menu command number
  83. #define cPrintMacAppClassInfo        1904    //menu command number
  84. #define cPrintAppClassInfo            1905    //menu command number
  85. #define cAppUserFlag1                        1906    //menu command number
  86. #define cAppUserFlag2                        1907    //menu command number
  87. #define cAppUserFlag3                        1908    //menu command number
  88. #endif
  89.  
  90. //--------------------------------------------------------------------------------------------------
  91. // Other Command Numbers - not for Menu Items
  92. //--------------------------------------------------------------------------------------------------
  93.  
  94. #define cSplashScreen            1950
  95. #define cExpandElement        1951    //for TTwistDownElement::DoScriptCommand
  96. #define cCollapseElement    1952    //for TTwistDownElement::DoScriptCommand
  97. #define cSetSearchMethod    1953    //Required for TTwistDownDocument::GetSetPropertyInfo
  98.  
  99. //--------------------------------------------------------------------------------------------------
  100. // AppleEvents for scripting support
  101. //--------------------------------------------------------------------------------------------------
  102. #define kTDLAEDispatchTable 1000    //aedt resource
  103.  
  104. #define cTwistDownView                'TDvw'    //AppleEvent class definition for the TTwistDownView
  105. #define cTwistDownElement            'TDel'    //AppleEvent class definition for the TTwistDownElement
  106.  
  107.  
  108. #define kAETerminologyExtension 'aete'
  109.  
  110. //AppleEvent event IDs
  111. #define kAEExpandAllID                                'exAL'    // cExpandAll    
  112. #define kAECollapseAllID                            'clAL'    // cCollapseAll
  113. #define kAEExpandElementID                        'exLI'    // cExpandElement
  114. #define kAECollapseElementID                    'clLI'    // cCollapseElement
  115.  
  116. #if qDebug
  117. #define kAEResetObjectCountID                    'rsOC'    // cResetObjectCount
  118. #endif
  119.  
  120. //Writing direction enumerations
  121. #define enumWritingDirection    'WDir'
  122. #define kAELeftToRight                'ltRT'
  123. #define kAERightToLeft                'rtLT'
  124.  
  125. //Search method for finding things in the list
  126. #define     enumSearchMethod    'SMth'
  127. #define     kAEVisibleList        'SVli'
  128. #define     kAEWholeList            'SWli'
  129.  
  130. //Apple Event routing
  131. #define     enumAERouting            'EAEr'
  132. #define     kAERouteToDoc            'RDoc'
  133. #define     kAERouteToView        'RVew'
  134.  
  135. //Properties of TTwistDownApp
  136. #define pShowInvisibleFiles      'SHin'
  137. #define pUseSystemDirection        'usSD'
  138. #define pSendAppleEvents            'snAE'
  139. #define pFailHere                            'FlHr'
  140. #define pAERouting                        'AERt'
  141. #define pUnlimitedDocs                'ULDs'
  142.  
  143. #if qDebug
  144.     #define pObjectCountingEnabled    'cObj'
  145.     #define pPrBaseClassInfo                'prBC'
  146.     #define pPrMacAppClassInfo            'prMA'
  147.     #define pPrAppClassInfo                    'prAp'
  148.     #define pSetAppUserFlag1                'sUF1'
  149.     #define pSetAppUserFlag2                'sUF2'
  150.     #define pSetAppUserFlag3                'sUF3'
  151. #endif
  152.     
  153. //Properties of TTwistDownDocument
  154. #define pNumFolders                         'Nfld'            // number of folders in the twist down list
  155. #define pNumFiles                             'Nfil'            // number of files in the twist down list
  156. #define pNumItems                             'Nitm'            // sum of number of folders and number of files in the twist down list
  157. #define pSearchMethod                    'SMTH'
  158.  
  159. //Properties of TTwistDownView
  160. #define pWritingDirection            'wDir'
  161. #define keyAEWritingDirection    'wDIR'
  162. #define pCouldExpand                  'CDex'            // fCouldExpand
  163. #define pCouldCollapse              'CDcl'            // fCouldCollapse    
  164. #define pFontName                          'fntN'            
  165.  
  166. //Properties for TTwistDownElement
  167. #define pHasSubList                        'hsSL'
  168. #define pShowSubList                    'shSL'
  169. #define pHasControl                        'hsCT'
  170. #define pItemInList                        'liTM'    //Absolute position in the list
  171. #define pIndentLevel                    'INDT'    
  172.  
  173. //--------------------------------------------------------------------------------------------------
  174. // STR# resources except for BalloonHelp STR# resources
  175. //--------------------------------------------------------------------------------------------------
  176.  
  177. #define kTwistDownTitles                                            1001
  178. #define kProgressDialogTitles                                    1002
  179. #define kProgressIndicatorOperationStrings        1003
  180. #define kMenuNameStrings                                            9999    //for toggled commands
  181.  
  182. //----------------------------------------------------------------------------------------
  183. // Menu Items name indices for toggled commands
  184. //----------------------------------------------------------------------------------------
  185. #define kLeftToRightNameIdx     1
  186. #define kRightToLeftNameIdx     2
  187. #define kRouteToDocNameIdx         3
  188. #define kRouteToViewNameIdx     4
  189.  
  190. resource 'STR#' (kMenuNameStrings,
  191. #if qNames
  192. "Menu Name Strings",
  193. #endif
  194. nonpurgeable) {
  195.     {
  196. /* [1] */    "Left to Right",
  197. /* [2] */    "Right to Left",
  198. /* [3] */    "Route to Doc",
  199. /* [4] */    "Route to View",
  200.     }
  201. };
  202. //--------------------------------------------------------------------------------------------------
  203. // 'View' resources
  204. //--------------------------------------------------------------------------------------------------
  205. #define  kTwistDownViewID                      'SYVW'
  206. #define  kChangeFontSizeViewID          'SIZE'
  207. #define  kSizeValueViewID                        'fsvl'
  208. #define  kProgressViewID                        'prog'
  209. #define  kProgressOperationViewID        'Oper'
  210. #define  kProgressSubjectViewID            'Vol '
  211. #define  kProgressBarViewID                    'pBar'
  212. #define  kAboutProgNameViewID                'pNam'    //TStaticText ID for Program name in the about box
  213. #define  kAboutCopyrightViewID            'cprt'    //TStaticText ID for copyright in the about box
  214.  
  215. #define  kTwistDownControlViewID        'TDct'    //Not really needed but useful when debugging
  216.                                                                                         //because it allows you to identify a twistDowncontrol.
  217.  
  218. #define kAboutBoxWindowID                    2000
  219. #define kTwistDownWindowID                2002
  220. #define kChangeFontSizeWindowID        2003
  221. #define kProgressWindowID                    2004
  222.  
  223.  
  224. //--------------------------------------------------------------------------------------------------
  225. // BalloonHelp stuff
  226. //--------------------------------------------------------------------------------------------------
  227.  
  228. #define kChangeFontSizeDialogHelp        3006
  229. #define kTwistDowncontrolHelp                3011
  230. #define kProgressDialogHelp                 5001
  231.  
  232. #define kAppIconHelpStrings                             3000
  233. #define kTDLMenuHelpStrings                             3001
  234. #define kFormatMenuHelpStrings                         3002
  235. #define kFontMenuHelpStrings                             3003
  236. #define kSizeMenuHelpStrings                             3004
  237. #define kWindowsMenuHelpStrings                     3005
  238. #define kChangeFontSizeDialogHelpStrings    3006
  239. #define kWritingDirectionHelpStrings            3007
  240. #define kControlMenuHelpStrings                        3008
  241. #define kAppleEventsHelpStrings                        3009
  242.  
  243. #if qDebug
  244. #define kTestMenuHelpStrings                            3010
  245. #endif
  246. #define kTwistDownControlHelpStrings            3011
  247. #define kProgressDialogHelpStrings                 5001
  248.  
  249.  
  250. //--------------------------------------------------------------------------------------------------
  251. // Errors
  252. //--------------------------------------------------------------------------------------------------
  253. #define  kErrorStrings    6001
  254. #define  msgNotHFSVolume        messageLookup + -26002
  255. #define  errNotHFSVolume        -26002
  256.  
  257. #define  msgAENotAFolder        messageLookup + -26003
  258. #define  errAENotAFolder        -26003
  259.  
  260. #define  msgTooManyRows        messageLookup + -26004
  261. #define  errTooManyRows        -26004
  262.  
  263. #define  msgCantExpandElement        messageLookup + -26005
  264. #define  errCantExpandElement        -26005
  265.  
  266. #define  msgListAlreadyExpanded        messageLookup + -26006
  267. #define  errListAlreadyExpanded        -26006
  268.  
  269. #define  msgListAlreadyCollapsed    messageLookup + -26007
  270. #define  errListAlreadyCollapsed    -26007
  271.  
  272. #define  msgElementAlreadyExpanded messageLookup + -26008
  273. #define  errElementAlreadyExpanded    -26008
  274.  
  275. #define  msgElementAlreadyCollapsed    messageLookup + -26009
  276. #define  errElementAlreadyCollapsed    -26009
  277.  
  278. #define  msgFailHere messageLookup + -26010
  279. #define  errFailHere -26010
  280. //----------------------------------------------------------------------------------------
  281. //    Other Constants
  282. //----------------------------------------------------------------------------------------
  283. #define  kDefaultOKItemID     'ok  '
  284. #define  kCancelItemID            'cncl'
  285. #define  kStopItemID                'stop'
  286.  
  287.  
  288. //End of items that are also defined in TwistDownGlobals.h
  289. // Byte values of hierarchical menu ids
  290. #define hmFontMenu            "\0x08"
  291.  
  292. #endif